import request from "@/utils/request";
import { BillLockForm, BillLockQuery } from "./types";
import { AxiosPromise } from "axios";

/**
 * 店铺分页数据
 *
 * @param queryParams
 */
export function getBillLockPage(
	queryParams: BillLockQuery
): AxiosPromise<PageResult<[]>> {
	return request({
		url: '/api/v1/billLock/page',
		method: 'get',
		params: queryParams
	});
}

/**
 * 获取店铺表单数据
 *
 * @param queryParams
 */
export function getBillLockForm(id: number): AxiosPromise<BillLockForm> {
	return request({
		url: '/api/v1/billLock/' + id + '/form',
		method: 'get'
	});
}

/**
 * 保存店铺
 *
 * @param data
 */
export function saveBillLock(data: BillLockForm) {
  return request({
    url: "/api/v1/billLock",
    method: "post",
    data: data,
  });
}

/**
 * 删除店铺
 *
 * @param ids
 */
export function deleteBillLock(ids: string) {
	return request({
		url: '/api/v1/billLock/' + ids,
		method: 'delete'
	});
}
